package cn.fl.riskctrl.service.impl;

import cmm.mid.core.framework.dto.BaseParamDTO;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.fl.riskctrl.service.IRcCstCarInfoService;
import fl.riskctrl.facade.externalinterface.service.api.IExternalRcCstCarInfoApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
* 修改车牌号信息
 * @package: cn.fl.riskctrl.service.impl
 * @className: RcCstCarInfoServiceImpl
 * @author: chenjunnan@lionbridgecapital.cn
 * @createDate: 2019/8/23 13:45
 * @version: V1.0.0
 * @copyright: (c) 2019
 * @updateRemark: [序号][YYYY-MM-DD] [更改人姓名][变更描述]
 */
@Service
public class RcCstCarInfoServiceImpl implements IRcCstCarInfoService {

    /**
     * 日志
     */
    private static final Logger logger = LoggerFactory.getLogger(RcCstCarInfoServiceImpl.class);
    @Autowired
    private IExternalRcCstCarInfoApiService externalRcCstCarInfoApiService;

    @Override
    public DataResultVO exeCarInfo(Long rcCstBscInfoId, String rskLvlCd2) throws BaseException {
        DataResultVO rs = new DataResultVO();
        try {
            BaseParamDTO baseParamDTO = new BaseParamDTO();
            DataResultDTO result = externalRcCstCarInfoApiService.updateCarInfo(rcCstBscInfoId,rskLvlCd2,baseParamDTO);
            rs.setSuccess(result.getSuccess());
            rs.setInfo(result.getInfo());
        } catch (BaseException e) {
            BaseLogUtils.error(logger, "exeCarInfo", e.getMessage(), e);
            throw e;
        }
        return rs;
    }
}
